#Include <File.au3>

$logfile = FileOpenDialog("Select Only the log file by Dup()", ".", "Text files (*.txt)", 1)
if @Error = 1 then exit
Local $aFile 
_FileReadToArray($logfile,$aFile)
$file2 = "frame lose log.txt"	
	
For $i = 3 to $aFile[0]
	;ConsoleWrite($aFile[$i] & @crlf)
	$var = StringSplit($aFile[$i]," frm ",1)
	$frame = $var[3]
	$n = 1
		While 1
			If  $i+$n < $aFile[0] Then
				$var = StringSplit($aFile[$i+$n]," frm ",1)
				If $var[3] = $frame Then
					$n = $n+1
				Else
					$i = $i+$n
					ExitLoop
				EndIf
			Else
				ExitLoop
			EndIf
		WEnd
		If $n > 1 Then
			;ConsoleWrite($n&" Lost after frame number: "&$frame & @crlf)
			FileWriteLine(@ScriptDir&"\"&$file2,$n&" Lost after frame number: "&$frame)
		EndIf
Next
MsgBox(0,"Done","Done!")